In active sensing, a spatial mask, comprising a known pattern, is illuminated or projected onto a scene or object. A structure of the pattern projected on the scene or object typically encodes depth information for the scene or object. A receiver sensor captures an image of the scene or object with the spatial mask thereon. The pattern or code within the spatial mask in the captured image is then used to ascertain a depth for the scene or object in the image. This depth information may be used, for instance, to reconstruct a 3-dimensional representation of the scene or object.
Most scenes or objects have varying depths leading to distortions of the pattern in the spatial mask. That is, as the spatial mask is projected onto the scene or object, the curves, depth, shapes of the scene or object cause parts of the pattern projected thereon to become distorted. Such distortion tends to inhibit accurate identification of the pattern of the spatial mask.
Therefore, a solution is needed to correctly recognize spatial codes that may have been distorted under various conditions.